<%@ page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <title>Simple markers</title>
    <style>
      html, body, #map-canvas {
        height: 80%;
        margin: 0px;
        padding: 0px
      }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    <script>
function initialize() {
	var myLatlng = new google.maps.LatLng(1.2,103.8);
	  var mapOptions = {
	    zoom: 4,
	    center: myLatlng
	  }
	  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
	  $.getJSON("/HelloWeb/findCoords", function(coordsList) {
	        $.each(coordsList, function() {
	        	alert("lalala");
	        	var myLatlng = new google.maps.LatLng(this.lat,this.lng);
	        	var marker = new google.maps.Marker({
	        	      position: myLatLng,
	        	      map: map,
	        	  });
	        });
	    });
}
google.maps.event.addDomListener(window, 'load', initialize);


    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
    <h2></h2>
 </body>
</html>